-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New ImGui IO event API #23
base: master
Are you sure you want to change the base?
Conversation
{ | ||
if (MouseIndex < Utilities::GetArraySize(MouseButtonsDown)) | ||
const ImGuiKey& ImKey = ImGuiInterops::UnrealToImGuiKey(Key); | ||
IO.AddKeyEvent(ImKey, bIsDown); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UnrealToImGuiKey has ImGuiKey_LeftShift
, ImGuiKey_RightShift
, ImGuiKey_LeftControl
, ImGuiKey_RightControl
, ImGuiKey_LeftAlt
, ImGuiKey_RightAlt
, ImGuiKey_LeftSuper
and ImGuiKey_RightSuper
But we also need to pass events for ImGuiKey_ModShift
, ImGuiKey_ModControl
, ImGuiKey_ModAlt
and ImGuiKey_ModSuper
.
Maybe you can have a UnrealToImGuiModKeyMap
map UnrealToImGuiKeyMap
just like as:
{
EKeys::LeftShift : ImGuiKey_ModShift,
EKeys::RigthShift : ImGuiKey_ModShift,
EKeys::LeftControl : ImGuiKey_ModCtrl,
EKeys::RightControl : ImGuiKey_ModCtrl,
EKeys::LeftAlt : ImGuiKey_ModAlt,
EKeys::RightAlt : ImGuiKey_ModAlt,
EKeys::LeftCommand : ImGuiKey_ModSuper,
EKeys::RightCommand : ImGuiKey_ModSuper,
}
And then:
if(ImGuiInterops::UnrealToImGuiModKey(Key) != ImGuiKey_None)
{
// Will need UnrealToImGuiModKey function just like UnrealToImGuiKey, maybe without the log
IO.AddKeyEvent(ImGuiInterops::UnrealToImGuiModKey(Key), bIsDown);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without these anything that uses Mod keys break with this PR change
Is this properly tested? I gave it a try but keyboard & gamepad navigations both not working anymore after applying the diff. |
This pull request reworks the Unreal backend for ImGui to use the new IO event API introduced in ImGui 1.87.
Most of the intermediate storage has been removed in this project as core ImGui now handles it correctly even at low framerates. Certain missing keybinds have been added (such as Super/Command).
It is advisable for users of this project to thoroughly review and test this before it is merged.